#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int missingNumber(int* nums, int numsSize)
{
	int i = 0, num = 0;
	for (i = 1; i <= numsSize; i++)
	{
		num += i;
	}
	for (i = 0; i < numsSize; i++)
	{
		num -= *(nums + i);
	}
	return num;
}

int main()
{
	int arr[] = { 0,3,1 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	printf("%d", missingNumber(arr, sz));
	return 0;
}


